package exceptiontest;

public class ThrowDemo {
    public static void main(String[] args) {
        Student zs=new Student();
        try {
            zs.setAge(10);
            System.out.println(zs.getAge());
        }catch (RuntimeException e){
            System.out.println("年龄不合法");
        }
    }
}
